%% Autosense Sensor Configuaration %%
function SENSOR=config_sensor()

SENSOR.R_RIPID = 1;        SENSOR.R_ACLXID=4;     SENSOR.A_ALCID=7;    SENSOR.R_BAT_SKN_AMB_ID=10;
SENSOR.R_ECGID = 2;        SENSOR.R_ACLYID=5;     SENSOR.A_GSRID=8;
SENSOR.R_GSRID = 3;        SENSOR.R_ACLZID=6;     SENSOR.A_TEMPID=9;                     
SENSOR.P_ACLXID=11;
SENSOR.P_ACLYID=12;
SENSOR.P_ACLZID=13;
SENSOR.P_GPS_LATID=14;
SENSOR.P_GPS_LONGID=15;
SENSOR.P_GPS_ALTID=16;
SENSOR.P_GPS_SPDID=17;
SENSOR.P_GPS_BEAR=18;
SENSOR.P_GPS_ACCURACYID=19;

SENSOR.ID(SENSOR.R_RIPID).NAME='SENSOR_RIP';       SENSOR.ID(SENSOR.R_ECGID).NAME='SENSOR_ECG';
SENSOR.ID(SENSOR.R_RIPID).FREQ=64.0/3.0;           SENSOR.ID(SENSOR.R_ECGID).FREQ=64.0; 
SENSOR.ID(SENSOR.R_RIPID).TOS_CHANNEL=7;           SENSOR.ID(SENSOR.R_ECGID).TOS_CHANNEL=0;
SENSOR.ID(SENSOR.R_RIPID).DB_TABLE='sensor21';     SENSOR.ID(SENSOR.R_ECGID).DB_TABLE='sensor12';
SENSOR.ID(SENSOR.R_RIPID).READFROM='TOS';          SENSOR.ID(SENSOR.R_ECGID).READFROM='TOS';
%% Autosense Sensor Configuaration

SENSOR.ID(SENSOR.R_GSRID).NAME='SENSOR_GSR';       SENSOR.ID(SENSOR.R_ACLXID).NAME='SENSOR_ACCELX';
SENSOR.ID(SENSOR.R_GSRID).FREQ=64.0/6.0;           SENSOR.ID(SENSOR.R_ACLXID).FREQ=64.0/6.0;
SENSOR.ID(SENSOR.R_GSRID).TOS_CHANNEL=4;           SENSOR.ID(SENSOR.R_ACLXID).TOS_CHANNEL=1;
SENSOR.ID(SENSOR.R_GSRID).DB_TABLE='sensor13';     SENSOR.ID(SENSOR.R_ACLXID).DB_TABLE='sensor18';
SENSOR.ID(SENSOR.R_GSRID).READFROM='TOS';          SENSOR.ID(SENSOR.R_ACLXID).READFROM='TOS';

SENSOR.ID(SENSOR.R_ACLYID).NAME='SENSOR_ACCELY';    SENSOR.ID(SENSOR.R_ACLZID).NAME='SENSOR_ACCELZ';
SENSOR.ID(SENSOR.R_ACLYID).FREQ=64.0/6.0;           SENSOR.ID(SENSOR.R_ACLZID).FREQ=64.0/6.0;
SENSOR.ID(SENSOR.R_ACLYID).TOS_CHANNEL=2;           SENSOR.ID(SENSOR.R_ACLZID).TOS_CHANNEL=3;
SENSOR.ID(SENSOR.R_ACLYID).DB_TABLE='sensor19';     SENSOR.ID(SENSOR.R_ACLZID).DB_TABLE='sensor20';
SENSOR.ID(SENSOR.R_ACLYID).READFROM='TOS';          SENSOR.ID(SENSOR.R_ACLZID).READFROM='TOS';

SENSOR.ID(SENSOR.A_ALCID).NAME='ALC_ALCOHOL';       SENSOR.ID(SENSOR.A_GSRID).NAME='ALC_GSR';      
SENSOR.ID(SENSOR.A_ALCID).FREQ=6.4;                 SENSOR.ID(SENSOR.A_GSRID).FREQ=6.4;     
SENSOR.ID(SENSOR.A_ALCID).TOS_CHANNEL=10;           SENSOR.ID(SENSOR.A_GSRID).TOS_CHANNEL=11;      
SENSOR.ID(SENSOR.A_ALCID).DB_TABLE='sensor27';      SENSOR.ID(SENSOR.A_GSRID).DB_TABLE='sensor28';
SENSOR.ID(SENSOR.A_ALCID).READFROM='TOS';           SENSOR.ID(SENSOR.A_GSRID).READFROM='TOS';

SENSOR.ID(SENSOR.A_TEMPID).NAME='ALC_TEMPERATURE';   SENSOR.ID(SENSOR.R_BAT_SKN_AMB_ID).NAME='1BATTERY_2SKIN_3AMBIENT_4UNKNOWN_5UNKNOWN';      
SENSOR.ID(SENSOR.A_TEMPID).FREQ=6.4;                 SENSOR.ID(SENSOR.R_BAT_SKN_AMB_ID).FREQ=6.4;     
SENSOR.ID(SENSOR.A_TEMPID).TOS_CHANNEL=12;           SENSOR.ID(SENSOR.R_BAT_SKN_AMB_ID).TOS_CHANNEL=8;      
SENSOR.ID(SENSOR.A_TEMPID).DB_TABLE='sensor29';      SENSOR.ID(SENSOR.R_BAT_SKN_AMB_ID).DB_TABLE='';
SENSOR.ID(SENSOR.A_TEMPID).READFROM='TOS';           SENSOR.ID(SENSOR.R_BAT_SKN_AMB_ID).READFROM='TOS';

%% Phone Sensor Configuration
SENSOR.ID(SENSOR.P_ACLXID).NAME='PHONE_ACCELX';     SENSOR.ID(SENSOR.P_ACLYID).NAME='PHONE_ACCELY';
SENSOR.ID(SENSOR.P_ACLXID).FREQ=64.0/6.0;           SENSOR.ID(SENSOR.P_ACLYID).FREQ=64.0/6.0;
SENSOR.ID(SENSOR.P_ACLXID).DB_TABLE='sensor30';     SENSOR.ID(SENSOR.P_ACLYID).DB_TABLE='sensor31';
SENSOR.ID(SENSOR.P_ACLXID).READFROM='DB';           SENSOR.ID(SENSOR.P_ACLYID).READFROM='DB';

SENSOR.ID(SENSOR.P_ACLZID).NAME='PHONE_ACCELZ';    
SENSOR.ID(SENSOR.P_ACLZID).FREQ=64.0/6.0;      
SENSOR.ID(SENSOR.P_ACLZID).DB_TABLE='sensor32';
SENSOR.ID(SENSOR.P_ACLZID).READFROM='DB';

SENSOR.ID(SENSOR.P_GPS_LATID).NAME='GPS_LATITUDE';
SENSOR.ID(SENSOR.P_GPS_LATID).FREQ=0;
SENSOR.ID(SENSOR.P_GPS_LATID).DB_TABLE='sensor23';
SENSOR.ID(SENSOR.P_GPS_LATID).READFROM='LOC';
SENSOR.ID(SENSOR.P_GPS_LATID).CSV_COLUMN=1;

SENSOR.ID(SENSOR.P_GPS_LONGID).NAME='GPS_LONGITUDE';
SENSOR.ID(SENSOR.P_GPS_LONGID).FREQ=0; %??
SENSOR.ID(SENSOR.P_GPS_LONGID).DB_TABLE='sensor24';
SENSOR.ID(SENSOR.P_GPS_LONGID).READFROM='LOC';
SENSOR.ID(SENSOR.P_GPS_LONGID).CSV_COLUMN=2;

SENSOR.ID(SENSOR.P_GPS_ALTID).NAME='GPS_ALTITUDE';
SENSOR.ID(SENSOR.P_GPS_ALTID).FREQ=0;
SENSOR.ID(SENSOR.P_GPS_ALTID).DB_TABLE='sensor25';
SENSOR.ID(SENSOR.P_GPS_ALTID).READFROM='LOC';
SENSOR.ID(SENSOR.P_GPS_ALTID).CSV_COLUMN=3;

SENSOR.ID(SENSOR.P_GPS_SPDID).NAME='GPS_SPEED';  
SENSOR.ID(SENSOR.P_GPS_SPDID).FREQ=0;           
SENSOR.ID(SENSOR.P_GPS_SPDID).DB_TABLE='sensor25';
SENSOR.ID(SENSOR.P_GPS_SPDID).READFROM='LOC';
SENSOR.ID(SENSOR.P_GPS_SPDID).CSV_COLUMN=5;

SENSOR.ID(SENSOR.P_GPS_BEAR).NAME='GPS_BEAR';  
SENSOR.ID(SENSOR.P_GPS_BEAR).FREQ=0;           
SENSOR.ID(SENSOR.P_GPS_BEAR).DB_TABLE='sensor25';
SENSOR.ID(SENSOR.P_GPS_BEAR).READFROM='LOC';
SENSOR.ID(SENSOR.P_GPS_BEAR).CSV_COLUMN=5;

SENSOR.ID(SENSOR.P_GPS_ACCURACYID).NAME='GPS_ACCURACY';  
SENSOR.ID(SENSOR.P_GPS_ACCURACYID).FREQ=0;           
SENSOR.ID(SENSOR.P_GPS_ACCURACYID).DB_TABLE='sensor25';
SENSOR.ID(SENSOR.P_GPS_ACCURACYID).READFROM='LOC';
SENSOR.ID(SENSOR.P_GPS_ACCURACYID).CSV_COLUMN=6;

end
